<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:set var="reportTitle" value="PECVD膜厚值分布报表" scope="session"/>

<%@ include file="/common/report_head.jsp" %>
<%@ include file="/condition/sartTime_input.html"%>
<%@ include file="/condition/endTime_input.html"%>
<%@ include file="/condition/line_sumo.html"%>
<%@ include file="/condition/tool_sumo.html"%>
<%@ include file="/condition/pipeNumber_sumo.html"%>
<%@ include file="/condition/zhNumber_sumo.html"%>
<%@ include file="/condition/zhCount_sumo.html"%>
<%@ include file="/condition/zhPlace_sumo.html"%>

<%@ include file="/common/report_middle.jsp" %>
<%@ include file="/charts-grid/echarts2.html"%>
<div class="col-md-12" style="height: 420px;">
    <div id="pqGrid"></div>
</div>
<%@include file="/common/report_end.jsp" %>


<script>
    $(document).ready(function () {
        $("title").text("PECVD膜厚值分布报表");

        $('#query_btn').click(function (){
            initGridAndChart();
            ajax('/jn-report/report/pecvd_3_report.do' ,loadConditionMapData(), true, ajax_successful);

            function ajax_successful(outTrxObj) {
                if(outTrxObj.gridData.length < 1) { showMessengerDialog("数据查询为空"); return false; }

                //Chart图数据赋值
                var echartsData = outTrxObj.chartsData;
                option.color = ['#4F81BD', '#C0504D', '#DA953A', '#64D5F4', '#A5A5A5', '#FEC00F',  '#70AD47', '#255E91', '#636363', '#997311', '#264378','red', 'green', 'cyan', 'blue', 'purple',
                    'violet', 'skyblue', 'tan', 'wheat', 'darkkhaki', '#f7acbc', '#deab8a', '#817936', '#444693', '#f05b72', '#8f4b2e', '#f47920', '#ef5b9c', '#fedcbd', '#b2d235', '#1a2933', '#2a5caa'], //调色盘
                    option.grid.left = '5%';
                option.backgroundColor = 'white';
                option.grid.show = false;
                option.title.text = echartsData.title;
                option.legend.data = [];
                option.legend.data = echartsData.legendData;
                option.xAxis[0].data = [];
                option.xAxis[0].data = echartsData.xAxisData;
                option.yAxis[0].axisLabel = {formatter: '{value} %'};
                option.series = [];
                //柱状图
                option.series.push({
                    name: echartsData.legendData[0],
                    type: 'bar',
                    yAxisIndex: 0,
                    data: echartsData.seriesDatas[0],
                    barMaxWidth : 30,
                    itemStyle: {
                        normal: {
                            barBorderRadius: 0,
                            label: {
                                show: true,
                                position: 'top'
                            }
                        }
                    }
                });
                myChart.clear();
                myChart.setOption(option);

                //grid表格数据
                var colM =[
                    {halign:"center",align:'center', dataIndx: 'range_value',   title: '膜厚范围值', width: 130, editable: false, sortable: true},
                    {halign:"center",align:'center', dataIndx: 'range_percent', title: '范围比例',   width: 130, editable: false, sortable: true}
                ];
                _pqUtil.f.setColModel($("#pqGrid"), colM);
                _pqUtil.f.seTitle($("#pqGrid"), "PECVD膜厚值分布报表格");
                _pqUtil.f.isShowTitle($("#pqGrid"), false);
                _pqUtil.f.loadPqGridData($("#pqGrid"), outTrxObj.dynamicColumnJsonGridData);
            }
        });

    });
</script>
